function [p_llose3,p_llose2_lwon1,p_llose2_llost1,p_llose1,xl3,xh3,xl2_lwon1,xh2_lwon1,xl2_llost1,xh2_llost1,xl1,xh1,delta] = plot_transitions_effort_over_delta(no_gridpoints,c_l_case,c_h_case,V_l_case,V_h_case,k) 

c_l=c_l_case*ones(no_gridpoints,1);
c_h=c_h_case*ones(no_gridpoints,1);
V_l=V_l_case*ones(no_gridpoints,1);
V_h=V_h_case*ones(no_gridpoints,1);
N=no_gridpoints;
delta=zeros(N,1);
for i=1:no_gridpoints
    delta(i)=(i-1)*.001;
end

[p_lwin3,p_llose3]=transition_prob_oneshot(c_l,c_h,V_l,V_h,k);

% Equilibrium effort costs incurred in stage 3: Equal across symmetric players (equal marginal cost and equal contest prizes)
effortcostl_stage3=k*V_l.*( ((c_l./c_h).*(V_h./V_l)).^k ) ./ ( (ones(N,1)+((c_l./c_h).*(V_h./V_l)).^k).^2 );
effortcosth_stage3=k*V_h.*( ((c_l./c_h).*(V_l./V_h)).^k ) ./ ( (ones(N,1)+((c_l./c_h).*(V_l./V_h)).^k).^2 );
xl3=effortcostl_stage3./c_l;
xh3=effortcosth_stage3./c_h;

% Conditional on lwon1: Continuation values (in stage 3) conditional on stage-2 outcome (and stage-1 history)
vl_lwin2_lwon1 =V_l;                                        % For the two-setter here, player l earns the player-specific contest prize in stage 2 (no stage-3 utility flow)
vh_lwin2_lwon1 =zeros(N,1);
vl_llose2_lwon1=p_lwin3 .*V_l - effortcostl_stage3 - delta; % Each player's respective contest prize may be earned & effort cost & per-battle environmental disutility to be incurred in stage 3
vh_llose2_lwon1=p_llose3.*V_h - effortcosth_stage3 - delta;
spread_l=vl_lwin2_lwon1-vl_llose2_lwon1;                    % Player l's stage-2 win/lose payoff spread, conditional on lwon1
spread_h=vh_llose2_lwon1-vh_lwin2_lwon1;                    % Player h's stage-2 win/lose payoff spread, conditional on lwon1
% Equilibrium effort costs incurred in stage 2: Different across players given different win/lose payoffs spreads in stage 2
effortcostl_stage2=k*spread_l.*( ((c_l./c_h).*(spread_h./spread_l)).^k ) ./ ( (ones(N,1)+((c_l./c_h).*(spread_h./spread_l)).^k).^2 );
effortcosth_stage2=k*spread_h.*( ((c_h./c_l).*(spread_l./spread_h)).^k ) ./ ( (ones(N,1)+((c_h./c_l).*(spread_l./spread_h)).^k).^2 );
    % CORNER: If vh_llose2_lwon1<=0 <=> spread_h<=0, then battle-1 loser (player h in this case) throws the towel in battle 2: it is best to not exert effort, finish 2-0 and secure CV=0, than to try to transition to 1-1 with CV<0
    effortcostl_stage2=effortcostl_stage2.*(vh_llose2_lwon1>0);
    effortcosth_stage2=effortcosth_stage2.*(vh_llose2_lwon1>0);
    zero_spread_h=(spread_h==0);                 % Need to handle division by spread_h=0, which returned NaN
    effortcosth_stage2(zero_spread_h)=0;
% Divide a player's equilibrium effort cost by marginal cost to obtain effort choice; lambda=1
xl2_lwon1=effortcostl_stage2./c_l;
xh2_lwon1=effortcosth_stage2./c_h;
% Transition probabilities   
p_lwin2_lwon1 = xl2_lwon1.^k ./ (xl2_lwon1.^k + xh2_lwon1.^k);
% Can subsequently call on transition_prob_oneshot to speed up; as well as comment out the clear command?
%p_lwin2_lwon1=ones(N,1)./(ones(N,1)+(c_l./c_h.*spread_h./spread_l).^k);
%p_lwin2_lwon1=transition_prob_oneshot(c_l,c_h,spread_l,spread_h,k);
    % CORNER
    p_lwin2_lwon1(xl2_lwon1==0)=1;              % In battle 2, player l exerts infinitesimally positive effort and wins over player h who exerts 0 effort
p_llose2_lwon1=ones(N,1)-p_lwin2_lwon1;

% lwin1
vl_lwin1=p_lwin2_lwon1.*vl_lwin2_lwon1 + p_llose2_lwon1.*vl_llose2_lwon1 - effortcostl_stage2 - delta;   % Continuation values (in stage 2) conditional on stage-1 outcome lwin1
vh_lwin1=p_lwin2_lwon1.*vh_lwin2_lwon1 + p_llose2_lwon1.*vh_llose2_lwon1 - effortcosth_stage2 - delta;
clear spread_l spread_h effortcostl_stage2 effortcosth_stage2 zero_spread_h;
clear effortcost_stage3;

% Conditional on llost1: Continuation values (in stage 3) conditional on stage-2 outcome (and stage-1 history)
vl_lwin2_llost1 =vl_llose2_lwon1;                           
vh_lwin2_llost1 =vh_llose2_lwon1;			
vl_llose2_llost1=zeros(N,1);	
vh_llose2_llost1=V_h;                                       % For the two-setter here, player h earns the player-specific contest prize in stage 2 (no stage-3 utility flow)
spread_l=vl_lwin2_llost1-vl_llose2_llost1;                  % Player l's stage-2 win/lose payoff spread, conditional on llost1
spread_h=vh_llose2_llost1-vh_lwin2_llost1;                  % Player h's stage-2 win/lose payoff spread, conditional on llost1
% Equilibrium effort costs incurred in stage 2: Different across players given different win/lose payoffs spreads in stage 2
effortcostl_stage2=k*spread_l.*( ((c_l./c_h).*(spread_h./spread_l)).^k ) ./ ( (ones(N,1)+((c_l./c_h).*(spread_h./spread_l)).^k).^2 );
effortcosth_stage2=k*spread_h.*( ((c_h./c_l).*(spread_l./spread_h)).^k ) ./ ( (ones(N,1)+((c_h./c_l).*(spread_l./spread_h)).^k).^2 );
    % CORNER: If vl_lwin2_llost1<=0 <=> spread_l<=0, then battle-1 loser (player l in this case) throws the towel in battle 2: it is best to not exert effort, finish 0-2 and secure CV=0, than to try to transition to 1-1 with CV<0
    effortcostl_stage2=effortcostl_stage2.*(vl_lwin2_llost1>0);
    effortcosth_stage2=effortcosth_stage2.*(vl_lwin2_llost1>0);
    zero_spread_l=(spread_l==0);                 % Need to handle division by spread_l=0, which returned NaN 
    effortcostl_stage2(zero_spread_l)=0;
% Divide a player's equilibrium effort cost by marginal cost to obtain effort choice; lambda=1
xl2_llost1=effortcostl_stage2./c_l;
xh2_llost1=effortcosth_stage2./c_h;
% Transition probabilities
p_lwin2_llost1 = xl2_llost1.^k ./ (xl2_llost1.^k + xh2_llost1.^k);
% Can subsequently call on transition_prob_oneshot to speed up; as well as comment out the clear commands?
%p_lwin2_llost1=ones(N,1)./(ones(N,1)+(c_l./c_h.*spread_h./spread_l).^k);
%p_lwin2_llost1=transition_prob_oneshot(c_l,c_h,spread_l,spread_h,k);
    % CORNER
    p_lwin2_llost1(xl2_llost1==0)=0;              % In battle 2, player h exerts infinitesimally positive effort and wins over player l who exerts 0 effort
p_llose2_llost1=ones(N,1)-p_lwin2_llost1;

% llose1
vl_llose1=p_lwin2_llost1.*vl_lwin2_llost1 + p_llose2_llost1.*vl_llose2_llost1 - effortcostl_stage2 - delta; % Again, continuation values (in stage 2) conditional on stage-1 outcome llose1
vh_llose1=p_lwin2_llost1.*vh_lwin2_llost1 + p_llose2_llost1.*vh_llose2_llost1 - effortcosth_stage2 - delta;
clear spread_l spread_h effortcostl_stage2 effortcosth_stage2 zero_spread_l;

% Stage 1
spread_l=vl_lwin1 -vl_llose1;                          % Player l's stage-1 win/lose payoff spread
spread_h=vh_llose1-vh_lwin1;                           % Player h's stage-1 win/lose payoff spread
% Equilibrium effort costs incurred in stage 1: Equal across symmetric players given equal win/lose payoff spreads in stage 1
effortcostl_stage1=k*spread_l.*( ((c_l./c_h).*(spread_h./spread_l)).^k ) ./ ( (ones(N,1)+((c_l./c_h).*(spread_h./spread_l)).^k).^2 );
effortcosth_stage1=k*spread_h.*( ((c_h./c_l).*(spread_l./spread_h)).^k ) ./ ( (ones(N,1)+((c_h./c_l).*(spread_l./spread_h)).^k).^2 );
    % CORNER: If spread_h<=0, then player h throws the towel already in battle 1: it is best not to exert effort already in battle 1, since CV at 1-0 is less negative than the CV at 0-1
    effortcostl_stage1=effortcostl_stage1.*(spread_h>0);
    effortcosth_stage1=effortcosth_stage1.*(spread_h>0);
    zero_spread_h=(spread_h==0);                 % Need to handle division by spread_h=0, which returned NaN
    effortcosth_stage1(zero_spread_h)=0;
% Divide a player's equilibrium effort cost by marginal cost to obtain effort choice; lambda=1
xl1=effortcostl_stage1./c_l;
xh1=effortcosth_stage1./c_h;
% Transition probabilities   
p_lwin1 = xl1.^k ./ (xl1.^k + xh1.^k);
% Can subsequently call on transition_prob_oneshot to speed up; as well as comment out the clear commands?
%p_lwin1=ones(N,1)./(ones(N,1)+(c_l./c_h.*spread_h./spread_l).^k);
%p_lwin1=transition_prob_oneshot(c_l,c_h,spread_l,spread_h,k);
    % CORNER
    p_lwin1(xl1==0)=1;              % In battle 1, player l exerts infinitesimally positive effort and wins over player h who exerts 0 effort
p_llose1=ones(N,1)-p_lwin1;
clear spread_l spread_h effortcostl_stage1 effortcosth_stage1 zero_spread_h;

end